package cn.zhibang.sannuo.web.controller;

import cn.zhibang.sannuo.commons.model.CheckUp;
import cn.zhibang.sannuo.commons.model.Menu;
import cn.zhibang.sannuo.commons.model.Role;
import cn.zhibang.sannuo.maintenance.service.MCheckUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author AdminController
 * @version 1.0.0
 * @ClassName MaintenanceController.java
 * @Description TODO 系统维护
 * @createTime 2021年03月29日 18:57:00
 */
@Controller
@RequestMapping("/maintenance")
public class MaintenanceController {
    @Resource private MCheckUpService mCheckUpService;

    @GetMapping("/systemSetting")//系统设置
    public String systemSetting(Model model){
        List<CheckUp> checkUps = mCheckUpService.selAllCheckUp();
        model.addAttribute("checkUps", checkUps);
        return "html/system-setting";
    }

    @GetMapping("/order_view")
    public String order_view(){
        return "html/order-view";
    }

    @GetMapping("/menuManagement")//菜单管理
    public String menuManagement(){
        return "html/menu-management";
    }
    @GetMapping("/menu_update")//菜单编辑
    public String menu_update(Menu menu, Model model){
        model.addAttribute("menu", menu);
        return "html/menu_update";
    }

    @GetMapping("/role_cate")//角色权限
    public String role_cate(){
        return "html/role_cate";
    }

    @GetMapping("/role_find")//编辑角色信息
    public String role_find(Role role, Model model){
        model.addAttribute("role", role);
        return "html/role_find";
    }

}
